﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DiskFileUpload
{
    public class HttpWorkerFileUploadEventArgs : EventArgs
    {
        public long Length { get; set; }
        public long Position { get; set; }
    }

    public delegate void HttpWorkerFileUploadHandler( object sender, HttpWorkerFileUploadEventArgs e);


    // 为了便于测试，定义一个接口以统一对数据源的约定
    public interface IFileUpload
    {
        System.Text.Encoding Encoding { get; }
        long Length { get; }
        int Read(byte[] buffer,int offset, int count );

        int PreloadLength{ get;}
        int GetPreloadedBody( byte[] buffer, int offset);
        byte[] GetPreloadedBody();

        // 当前的位置
        long Position { get; }

        // 事件
        event HttpWorkerFileUploadHandler ReadComplete;

             
    }
}
